package com.yhx.service;

import com.yhx.pojo.User;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

@Component
@FeignClient(value = "SPRINGCLOUD-PROVIDER",fallbackFactory = UserClientServiceFallbackFactory.class)
public interface UserClientService {

    @GetMapping("/user/queryUser/{id}")
    public User queryUser(@PathVariable("id") Integer id);

    @GetMapping("/user/queryUsers")
    public List<User> queryUsers();

    @GetMapping("/user/queryUserByName/{name}")
    public List<User> queryUserByName(@PathVariable("name") String name);
}
